
#if !defined(MODULE_HPP)
#define MODULE_HPP


// ------------------------------------------------------------------------
// The "Module" class.
// ------------------------------------------------------------------------

/**
 * Base class for all architectural modules.
 * All architectural modules inherit this class
 */
class Module
{
    std::string _name;

protected:
    /// Next cycle in which this module should be woken up.
    cycles_t next_cycle;
    //cycles_t current_cycle;
    bool do_end;


public:
    /**
     * The basic ctor.
     */
    Module(const std::string&);

    /**
     * Destructor.
     */
    virtual ~Module(void);

    /**
     * Start a cycle.
     * A module-specific callback called at the beginning of
     * the cycles in which the module is operational.
     */
    virtual void Start(void) = 0;

    /**
     * End a cycle.
     * A module-specific callback called at the end of
     * the cycles in which the module is operational.
     */
    virtual void End(void) = 0;

    /**
     * Reset the module.
     * Called whenever the simulation is reset in Sim::reset(void).
     * \todo {Is this correct?}
     */
    virtual void Reset(void) = 0;

};


#endif // !defined(MODULE_HPP)
